home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 16
/
AMIGAplus Sonderheft 16 (1998)(ICP)(DE)[!].iso
/
pd
/
anwendungen
/
xpk_source
/
test
/
printfiletypes.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-08-27
|
2KB
|
74 lines
#define NAME "PrintFileTypes"
#define DISTRIBUTION "(Freeware) "
#define REVISION "0"
/* NOTE: This program depends on certain things, which may change. It is
only valid as long as the XpkMasterPrefs internal structures do not change.
It is only for tests and no standard use tool!!! Never distribute a binary
version of it or use it's routines in other programs! */
/* Programmheader
Name: PrintFileTypes
Author: SDI
Distribution: Freeware
Description: shows all filetypes defined with XpkMasterPrefs
Compileropts: -
Linkeropts: -l amiga
1.0 06.07.97 : first Version
*/
#include <proto/exec.h>
#include <proto/dos.h>
#include <xpk/xpkprefs.h>
#include "SDI_defines.h"
struct XpkTypeNode {
struct Node xtn_Node; /* standard node structure */
ULONG xtn_Size; /* hold complete size to free */
struct XpkTypePrefs xtn_TypePrefs; /* real data */
};
void main()
{
struct XpkPrefsSemaphore *semaphore;
struct XpkTypeNode *td;
Forbid();
if((semaphore = (struct XpkPrefsSemaphore *) FindSemaphore(XPKPREFSSEMNAME)))
ObtainSemaphoreShared((struct SignalSemaphore *) semaphore);
Permit();
if(semaphore)
{
if(semaphore->xps_PrefsType == XPREFSTYPE_STANDARD)
{
struct Node *n;
UBYTE a[5] = "----";
for(n = ((struct List *)semaphore->xps_PrefsData)->lh_Head;
n->ln_Succ; n = n->ln_Succ)
{
td = (struct XpkTypeNode *) n;
if(td->xtn_TypePrefs.xtp_PackerData->xtd_Flags & XTD_NoPack)
a[0] = a[1] = a[2] = a[3] = '-';
else if(td->xtn_TypePrefs.xtp_PackerData->xtd_Flags & XTD_ReturnError)
a[0] = a[1] = a[2] = a[3] = '*';
else
{
a[0] = td->xtn_TypePrefs.xtp_PackerData->xtd_StdID>>24;
a[1] = td->xtn_TypePrefs.xtp_PackerData->xtd_StdID>>16;
a[2] = td->xtn_TypePrefs.xtp_PackerData->xtd_StdID>>8;
a[3] = td->xtn_TypePrefs.xtp_PackerData->xtd_StdID;
}
Printf("%-20s %-15s %s %s\n", td->xtn_TypePrefs.xtp_TypeName,
td->xtn_TypePrefs.xtp_NamePattern, a,
td->xtn_TypePrefs.xtp_FilePattern);
}
}
ReleaseSemaphore((struct SignalSemaphore *) semaphore);
}
}